<ui:composition template="/WEB-INF/templates/showcase.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:o="http://omnifaces.org/ui"
	xmlns:of="http://omnifaces.org/functions"
>
	<ui:define name="description">
		<p>
			Collection of EL functions for array manipulation: <code>of:createArray()</code>, <code>of:createIntegerArray()</code>,  
			and <code>of:contains()</code>.
		</p>
		<ui:include src="/WEB-INF/includes/utils/feature-request.xhtml" />
	</ui:define>		
	
	<ui:define name="demo">
		<p>
			Create a dummy array of size 5:
			<ui:repeat value="#{of:createArray(5)}" varStatus="loop">
				#{loop.index}#{!loop.last ? ', ' : ''}
			</ui:repeat>
		</p>
		<p>
			Create an integer array with specified start and end:
			<h:selectOneMenu value="#{bean.dayAsInteger}"> <!-- Note: just for demo, bean doesn't exist. -->
				<f:selectItems value="#{of:createIntegerArray(1, 31)}" />
			</h:selectOneMenu>
			<ui:param name="year" value="#{of:formatDate(now, 'yyyy')}" />
			<h:selectOneMenu value="#{bean.yearAsInteger}"> <!-- Note: just for demo, bean doesn't exist. -->
				<f:selectItems value="#{of:createIntegerArray(year, year - 10)}" />
			</h:selectOneMenu>
		</p>
		<p>
			Check if an array contains the specified value: 
			<a href="?test=7&amp;test=42&amp;test=69">clicking here should print true</a>:
			#{of:contains(paramValues.test, 42)}
		</p>
	</ui:define>
</ui:composition>